<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function fun() {
            console.log('这是声明函数，命名函数');
            console.log(fun.name);
        }
        console.log(fun.name);
        fun();

        var foo = function (){
            console.log('匿名表达式函数');
            console.log(foo.name);
            
        }
        console.log(foo.name);
        foo()
        var foo1 = function fn() {
            console.log('命名函数表达式');
            console.log(fn.name);
            
        }
        foo1();
    </script>
</body>
</html>